import request from '@/utils/request'

// 分页查询
export function getCustomerInfo(params ) {
    return request({
        url: '/customerManager/page',
        method: 'post',
        data: params  
    })
}


// 编辑客户初始数据回显
export function getEditCustomerInfo(id ) {
    return request({
        url: '/customers/'+id,
        method: 'get',
        data: id  
    })
}

//提交表单，更新数据库
export function updateCustomerInfo(data) {
    return request({
        url: '/customerManager/'+data.id,
        method: 'post',
        data: data  
    })

}

//提交表单，新增客户
export function insertCustomerInfo(insertCustomerInfo) {
    return request({
        url: '/customerManager/insert',
        method: 'post',
        data: insertCustomerInfo  
    })

}

//根据id删除客户
export function deleteCustomerInfo(delId) {
    return request({
        url: '/customerManager/delete',
        method: 'post',
        data: {id:delId } 
    })

}